package com.zzw.hj89;

import java.util.*;

/**
 * @Project: hw_java
 * @Description: 24点运算
 * @Author: zzw
 */
public class Main {

    private static Map<String, Integer> map = new HashMap<String, Integer>() {
        {
            put("2", 2);
            put("3", 3);
            put("4", 4);
            put("5", 5);
            put("6", 6);
            put("7", 7);
            put("8", 8);
            put("9", 9);
            put("10", 10);
            put("J", 11);
            put("Q", 12);
            put("K", 13);
            put("A", 1);
        }
    };

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String str = in.nextLine();
        if (str.toLowerCase().contains("joker")) {
            System.out.println("ERROR");
        } else {
            if (!dfs(str.split(" "), 0, "", 0)) {
                System.out.println("NONE");
            }
        }
    }

    public static boolean dfs(String[] nums, int res, String exp, int n) {
        for (int k = 0; k < nums.length; k++) {
            String temp = nums[k];
            if (!temp.equals("")) {
                nums[k] = "";
                int a = map.get(temp);
                if (n == 0) {
                    if (dfs(nums, a, exp + temp, n + 1)) {
                        return true;
                    }
                } else {
                    if (dfs(nums, res + a, exp + "+" + temp, n + 1) ||
                            dfs(nums, res - a, exp + "-" + temp, n + 1) ||
                            dfs(nums, res * a, exp + "*" + temp, n + 1) ||
                            a != 0 && dfs(nums, res / a, exp + "/" + temp, n + 1)) {
                        return true;
                    }
                }
                nums[k] = temp;
            }
        }
        if (res == 24 && n == nums.length) {
            System.out.println(exp);
            return true;
        }
        return false;
    }
}